// Returns true if the unit is unconscious or dead
// If an array is given, return true only if ALL units are dead or unconscious

//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "common\fn_isUnc.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);

private ["_result"];
_result = true;

if (IS_ARRAY(_this)) then {
	{
		_result = _result && (_x call FUNC(isUnc));
	} foreach _this;
} else {
	if (IS_OBJECT(_this) && {(_this isKindOf "Man")}) then {
		_result = !(alive _this) || (_this getVariable ["BTC_need_revive",0] != 0) || (_this getVariable ["xr_pluncon", false]);
		TRACE_1("Controled",ARR_4(_this,(alive _this),_this getVariable "BTC_need_revive", _this getVariable "xr_pluncon"));
	};
};

TRACE_1("End",_result);
_result
